package Java_Concurrency_in_Practice.c8_5;

import java.util.Set;

/**
 * 表示"搬箱子"之类谜题的抽象类
 * @param <P>
 * @param <M>
 */
public interface Puzzle<P, M> {
    P initialPosition();
    boolean isGoal(P position);

    /**
     * 规则允许的移动
     * @param position
     * @return
     */
    Set<M> legalMoves(P position);
    P move(P position, M move);
}
